import { postRequest, getRequest, getDownload } from '/@/lib/axios';

export const goodsApi = {
  // 添加商品
  addGoods: (param) => {
    return postRequest('/demo/goods/add', param);
  },
  // 删除
  deleteGoods: (goodsId) => {
    return getRequest(`/demo/goods/delete/${goodsId}`);
  },
  // 批量
  batchDelete: (goodsIdList) => {
    return postRequest('/demo/goods/batchDelete', goodsIdList);
  },
  // 分页查询
  queryGoodsList: (param) => {
    return postRequest('/demo/goods/query', param);
  },
  // 更新商品
  updateGoods: (param) => {
    return postRequest('/demo/goods/update', param);
  },

  // 导入
  importGoods: (file) => {
    return postRequest('/demo/goods/importGoods', file);
  },

  // 导出
  exportGoods: () => {
    return getDownload('/demo/goods/exportGoods');
  }
};
